Revert 20045:db1890f07661 "Revert alloc_idle_vcpu()..."
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Nov 2009 13:02:27 +0000 (13:02 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 12 Nov 2009 13:02:27 +0000 (13:02 +0000)
The old implementation of alloc_idle_vcpu() is unnecessary since
arch-specific code ensures that a single idle domain supports NR_CPUS
vcpus, despite the usual limit of MAX_VIRT_CPUS for ordinary domains.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/domain.c

index 5c64fb01a3383cd24ebd53a72f38a5e1c6ef9327..d47b55a93983b58e3d82c6c9dc681c027406f3f3 100644 (file)
@@ -186,19 +186,8 @@ struct vcpu *alloc_vcpu(
 
 struct vcpu *alloc_idle_vcpu(unsigned int cpu_id)
 {
-    struct domain *d;
-    struct vcpu *v;
-    unsigned int vcpu_id = cpu_id % MAX_VIRT_CPUS;
-
-    if ( (v = idle_vcpu[cpu_id]) != NULL )
-        return v;
-
-    d = (vcpu_id == 0) ?
-        domain_create(IDLE_DOMAIN_ID, 0, 0) :
-        idle_vcpu[cpu_id - vcpu_id]->domain;
-    BUG_ON(d == NULL);
-
-    return alloc_vcpu(d, vcpu_id, cpu_id);
+    return idle_vcpu[cpu_id] ?: alloc_vcpu(idle_vcpu[0]->domain,
+                                           cpu_id, cpu_id);
 }
 
 static unsigned int __read_mostly extra_dom0_irqs = 256;